package com.ruoyi.fpa.service.impl;

import java.util.List;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.util.SnowFlakeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fpa.mapper.FpaFunctionVafMapper;
import com.ruoyi.fpa.domain.FpaFunctionVaf;
import com.ruoyi.fpa.service.IFpaFunctionVafService;

/**
 * VAFService业务层处理
 *
 * @author koradji@163.com
 * @date 2023-09-13
 */
@Service
public class FpaFunctionVafServiceImpl implements IFpaFunctionVafService
{
    @Autowired
    private FpaFunctionVafMapper fpaFunctionVafMapper;

    /**
     * 查询VAF
     *
     * @param id VAF主键
     * @return VAF
     */
    @Override
    public FpaFunctionVaf selectFpaFunctionVafById(String id)
    {
        return fpaFunctionVafMapper.selectFpaFunctionVafById(id);
    }

    /**
     * 查询VAF列表
     *
     * @param fpaFunctionVaf VAF
     * @return VAF
     */
    @Override
    public List<FpaFunctionVaf> selectFpaFunctionVafList(FpaFunctionVaf fpaFunctionVaf)
    {
        return fpaFunctionVafMapper.selectFpaFunctionVafList(fpaFunctionVaf);
    }

    /**
     * 新增VAF
     *
     * @param fpaFunctionVaf VAF
     * @return 结果
     */
    @Override
    public int insertFpaFunctionVaf(FpaFunctionVaf fpaFunctionVaf)
    {
        if(StringUtils.isEmpty(fpaFunctionVaf.getId())) {
            fpaFunctionVaf.setId(String.valueOf(SnowFlakeUtils.snowFlakeId()));
        }
        return fpaFunctionVafMapper.insertFpaFunctionVaf(fpaFunctionVaf);
    }

    /**
     * 修改VAF
     *
     * @param fpaFunctionVaf VAF
     * @return 结果
     */
    @Override
    public int updateFpaFunctionVaf(FpaFunctionVaf fpaFunctionVaf)
    {
        return fpaFunctionVafMapper.updateFpaFunctionVaf(fpaFunctionVaf);
    }

    /**
     * 批量删除VAF
     *
     * @param ids 需要删除的VAF主键
     * @return 结果
     */
    @Override
    public int deleteFpaFunctionVafByIds(String[] ids)
    {
        return fpaFunctionVafMapper.deleteFpaFunctionVafByIds(ids);
    }

    /**
     * 删除VAF信息
     *
     * @param id VAF主键
     * @return 结果
     */
    @Override
    public int deleteFpaFunctionVafById(String id)
    {
        return fpaFunctionVafMapper.deleteFpaFunctionVafById(id);
    }
}
